<!DOCTYPE html>
<html>

	<head lang="en">
		<meta charset="UTF-8">
		<title>图片轮换</title>
		<link rel="stylesheet" href="css/scroll.css">
		<script type="text/javascript">
			var imgs = ["images/1.gif", "images/2.gif", "images/3.jpg", "images/4.jpg", "images/5.gif"];

			function repl(img) {
				var pic = document.getElementById("photo");
				pic.src = imgs[img.innerHTML - 1];
			}
		</script>
	</head>

	<body>
		<div class="scroll">
			<div id="num">
				<a href="#" onclick="repl(this)">1</a>
				<a href="#" onclick="repl(this)">2</a>
				<a href="#" onclick="repl(this)">3</a>
				<a href="#" onclick="repl(this)">4</a>
				<a href="#" onclick="repl(this)">5</a>
			</div>
			<img src="images/1.gif" alt="图片" id="photo" />
		</div>
	</body>

</html>